package com.fili.core;

import com.fili.core.serial.SerialLink;
import com.fili.core.serial.SerialParser;
import com.fili.core.storage.StorageContainer;
import com.fili.gui.view.DataView;

/**
 * Created by Claudiu-Florin FILIMON
 * Date: Oct 14, 2006
 * Time: 1:05:01 PM
 */
public class CentralNode
{
    private SerialLink serialLink;
    private SerialParser serialParser;
    private StorageContainer[] containers;
    private DataLinker[] linkers;


    public CentralNode(int count)
    {
        containers = new StorageContainer[count];
        serialParser = new SerialParser();
        serialLink = new SerialLink(serialParser);
    }

    public void linkTo(DataView[] dataVis)
    {
        int max = containers.length;
        if (dataVis.length < max)
            max = dataVis.length;

        linkers = new DataLinker[max];
        for (int i = 0; i < max; i++)
            linkers[i] = new DataLinker(i, containers[i], dataVis[i]);
    }
}
